home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / Make / source / build.sh.in < prev    next >
Encoding:
Text File  |  1997-09-19  |  2.3 KB  |  70 lines

  1. #!/bin/sh
  2. # Shell script to build GNU Make in the absence of any `make' program.
  3. # @configure_input@
  4.  
  5. # Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
  6. # This file is part of GNU Make.
  7. #
  8. # GNU Make is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2, or (at your option)
  11. # any later version.
  12. #
  13. # GNU Make is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with GNU Make; see the file COPYING.  If not, write to
  20. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. # See Makefile.in for comments describing these variables.
  23.  
  24. srcdir='@srcdir@'
  25. CC='@CC@'
  26. CFLAGS='@CFLAGS@'
  27. CPPFLAGS='@CPPFLAGS@'
  28. LDFLAGS='@LDFLAGS@'
  29. defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
  30. ALLOCA='@ALLOCA@'
  31. LOADLIBES='@LIBS@'
  32. extras='@LIBOBJS@'
  33. REMOTE='@REMOTE@'
  34.  
  35. # Common prefix for machine-independent installed files.
  36. prefix='@prefix@'
  37. # Common prefix for machine-dependent installed files.
  38. exec_prefix='@exec_prefix@'
  39. # Directory to find libraries in for `-lXXX'.
  40. libdir=${exec_prefix}/lib
  41. # Directory to search by default for included makefiles.
  42. includedir=${prefix}/include
  43.  
  44. # Exit as soon as any command fails.
  45. set -e
  46.  
  47. # These are all the objects we need to link together.
  48. objs="main.o commands.o job.o dir.o file.o misc.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/fnmatch.o glob/glob.o remote-${REMOTE}.o ${extras} ${ALLOCA}"
  49.  
  50. # Compile the source files into those objects.
  51. for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
  52.   echo compiling ${file}...
  53.   $CC $defines $CPPFLAGS $CFLAGS \
  54.       -c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
  55. done
  56.  
  57. # The object files were actually all put in the current directory.
  58. # Remove the source directory names from the list.
  59. srcobjs="$objs"
  60. objs=
  61. for obj in $srcobjs; do
  62.   objs="$objs `basename $obj`"
  63. done
  64.  
  65. # Link all the objects together.
  66. echo linking make...
  67. $CC $LDFLAGS $objs $LOADLIBES -o make.new
  68. echo done
  69. mv -f make.new make
  70.